package com.sg.common.enums;

import com.google.common.collect.Lists;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;

import java.util.List;

/**
 * @author yechangpeng
 * @version 1.0.0
 * TODO
 * @createTime 2022年04月07日 09:58:00
 */
@Getter
public enum ImageEnums {

    ROLE_ICON("ROLE_ICON", "角色图标", Lists.newArrayList(new Size("_104", 104, 104))),

    POWER_ICON("POWER_ICON", "权限图标", Lists.newArrayList(new Size("_104", 104, 104))),

    APP_BANNER("APP_BANNER", "应用banner", Lists.newArrayList(new Size("_550", 550, 1024))),

    APP_BIG_BANNER("APP_BIG_BANNER", "应用banner", Lists.newArrayList(new Size("_890", 890, 1024))),


    APP_FRAME_LOGO("APP_FRAME_LOGO", "应用框架logo", Lists.newArrayList(new Size("_104", 104, 104))),

    USER_HEAD("USER_HEAD", "用户头像", Lists.newArrayList(new Size("_20", 20, 20),
            new Size("_32", 32, 32), new Size("_40", 40, 40),
            new Size("_48", 48, 48), new Size("_80", 80, 80))),

    SPACE_HEAD("SPACE_HEAD", "空间头像", Lists.newArrayList(
            new Size("_32", 32, 32), new Size("_40", 40, 40),
            new Size("_48", 48, 48), new Size("_80", 80, 80))),

    OFFICICAL("OFFICICAL", "公文", Lists.newArrayList(
            new Size("_324", 324, 324))),

    OFFICICAL_FILE("OFFICICAL_FILE", "公文", Lists.newArrayList(
            new Size("_324", 324, 324))),

    WORK_PROJECT("WORK_PROJECT", "工作项", Lists.newArrayList(
            new Size("_324", 324, 324))),

    WORK_TASK("WORK_TASK", "工作任务", Lists.newArrayList(
            new Size("_324", 324, 324))),

    WORK_QUESTION("WORK_QUESTION", "工作问题", Lists.newArrayList(
            new Size("_324", 324, 324))),

    UPDATE_TASK_PROCESS("UPDATE_TASK_PROCESS", "更新任务进度", Lists.newArrayList(
            new Size("_324", 324, 324))),

    UPDATE_PROJECT_PROCESS("UPDATE_PROJECT_PROCESS", "更新项目进度", Lists.newArrayList(
            new Size("_324", 324, 324))),


    SCENE_LOGO("SCENE_LOGO", "场景logo", null),

    ABOUT_US_LOGO("ABOUT_US_LOGO", "关于我们logo", null),

    REPORT_THUMBNAIL("REPORT_THUMBNAIL", "汇报-缩略图", null),

    REPORT_CONTENT("REPORT_CONTENT", "汇报-内容图", null),

    REPORT_ATTACH("REPORT_ATTACH", "汇报-附件", null),

    PLAN_DATA("PLAN_DATA","规划资料",null),
    VIRTUAL_IMAGE("VIRTUAL_IMAGE","虚拟人物",null),


    ACHIVEMENT("ACHIVEMENT","成果附图",null),

    ACHIVEMENT_PIC("ACHIVEMENT_PIC","成果附图",null),

    WORK_TASK_THUMBNAIL_PIC("WORK_TASK_THUMBNAIL_PIC", "工作任务汇报-缩略图", null),
    WORK_TASK_ATT("WORK_TASK_ATT", "工作任务汇报-附件", null),

    PROBLEM_ATTACH("PROBLEM_ATTACH", "问题附件", null),
    PROBLEM_PIC("PROBLEM_PIC", "问题附图", null),

    PERSONAL_DISK("PERSONAL_DISK","个人自主网盘",null),

    DATA_RESOURCE("DATA_RESOURCE","数据资源",null),

    SEMANTIC_ENGINE("SEMANTIC_ENGINE","语义引擎图标",null);


    private String code;
    private String display;
    private List<Size> sizes;


    ImageEnums(String code, String display, List<Size> sizes) {
        this.code = code;
        this.display = display;
        this.sizes = sizes;
    }

    public static ImageEnums getEnumByCode(String code) {
        for (ImageEnums enums : ImageEnums.values()) {
            if (enums.code.equals(code)) {
                return enums;
            }
        }
        return null;
    }

    @Data
    @AllArgsConstructor
    public static class Size {

        private String suffix;

        private int high;

        private int width;
    }
}
